//
//  SignInViewController.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/12/20.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "SignInViewController.h"
#import "QRCodeCreateTool.h"
#import "SignInCountViewController.h"

@interface SignInViewController ()

@end

@implementation SignInViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"入场签到";
    self.view.backgroundColor = RGBColorOne(240);
    [self setNavi];
    [self setUpView];
}
- (void)setNavi
{
    UIButton *signBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 68, 30)];
    [signBtn setTitle:@"签到统计" forState:UIControlStateNormal];
    [signBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    signBtn.titleLabel.font = Font(14);
    [signBtn addTarget:self action:@selector(signClick) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:signBtn];
}
- (void)signClick
{
    SignInCountViewController *vc = [[SignInCountViewController alloc]init];
    vc.model = self.model;
    [self.navigationController pushViewController:vc animated:true];
}
- (void)setUpView
{
    UIView *containView = [[UIView alloc]initWithFrame:CGRectMake(0, (ScreenH-64-ScreenW)/2.0, ScreenW, ScreenW)];
    containView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:containView];
    
    UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(30, 30, ScreenW-60, ScreenW-60)];
    img.image = [QRCodeCreateTool createQRCodeWithString:self.model.code width:ScreenW-60];
    [containView addSubview:img];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
